package com.mycity.mapper;


import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.ResultSetExtractor;

import com.mycity.bean.User;


/**
 * 
 * @author <a href="izi.aviyente@gmail.com">Izi Aviyente</a>
 * @version $Id$
 */
public class UserSetExtractor implements ResultSetExtractor<User> {

	  @Override
	  public User extractData(ResultSet rs) throws SQLException {
	    User user = new User();
	    user.setUsername(rs.getString("username"));
	    user.setUserId(rs.getInt("userId"));
	    user.setEmail(rs.getString("email"));
	    user.setFirstName(rs.getString("name"));
	    user.setLastName(rs.getString("surname"));
	    user.setPassword(rs.getString("password"));
	    user.setBio(rs.getString("bio"));
	    user.setProfilePic(rs.getString("profilePic"));
	    return user;
	  }

} 